﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Diagnostics;
using CloudStorageLight.Core;

namespace CloudStorageLight.Core.Tests
{
    [TestClass]
    public class BlobContainerConfigTest
    {
        [TestMethod]
        public void ToXmlTest()
        {
            var obj = new BlobContainerConfig();

            obj.ContainerTypeName = typeof(CompositeBlobContainer).FullName;
            obj.Parameters = new string[]{ "", null};
            obj.Children = new BlobContainerConfig[] { 
            
                new BlobContainerConfig{
                    ContainerTypeName = typeof(FileBlobAdapter).FullName,
                    Parameters = new string[]
                    {
                        "/LocalFile/", "C:\\Temp\\", 
                    },
                },
            
                new BlobContainerConfig{
                    ContainerTypeName = typeof(AzureBlobAdapter).FullName,
                    Parameters = new string[]
                    {
                        "/Sub/", "files", null, 
                    },
                },

                new BlobContainerConfig{
                    ContainerTypeName = typeof(SpsBlobAdapter).FullName,
                    Parameters = new string[]
                    {
                        "/SharePoint/", "https://proaxiaconsulting.sharepoint.com",
                        "akihiroe.ehara@proaxiaconsulting.onmicrosoft.com", 
                        "password", "Shared Documents", 
                    },
                },


            };
            Trace.WriteLine(obj.ToXml());

            var target = obj.CreateBlobContainer(null, null);
        }
    }
}
